package operateur;

/**
 * Interface definition : GestionUtilisateur
 * 
 * @author OpenORB Compiler
 */
public abstract class GestionUtilisateurPOA extends org.omg.PortableServer.Servant
        implements GestionUtilisateurOperations, org.omg.CORBA.portable.InvokeHandler
{
    public GestionUtilisateur _this()
    {
        return GestionUtilisateurHelper.narrow(_this_object());
    }

    public GestionUtilisateur _this(org.omg.CORBA.ORB orb)
    {
        return GestionUtilisateurHelper.narrow(_this_object(orb));
    }

    private static String [] _ids_list =
    {
        "IDL:operateur/GestionUtilisateur:1.0"
    };

    public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte [] objectId)
    {
        return _ids_list;
    }

    private static final java.util.Map operationMap = new java.util.HashMap();

    static {
            operationMap.put("adherer",
                    new Operation_adherer());
            operationMap.put("authentifierClientMobile",
                    new Operation_authentifierClientMobile());
            operationMap.put("authentifierStation",
                    new Operation_authentifierStation());
            operationMap.put("authentifierTransporteurMobile",
                    new Operation_authentifierTransporteurMobile());
            operationMap.put("getClient",
                    new Operation_getClient());
            operationMap.put("getIorClient",
                    new Operation_getIorClient());
            operationMap.put("getIorTransporteur",
                    new Operation_getIorTransporteur());
            operationMap.put("getTransporteur",
                    new Operation_getTransporteur());
            operationMap.put("getZoneUtilisateur",
                    new Operation_getZoneUtilisateur());
    }

    public final org.omg.CORBA.portable.OutputStream _invoke(final String opName,
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler)
    {

        final AbstractOperation operation = (AbstractOperation)operationMap.get(opName);

        if (null == operation) {
            throw new org.omg.CORBA.BAD_OPERATION(opName);
        }

        return operation.invoke(this, _is, handler);
    }

    // helper methods
    private org.omg.CORBA.portable.OutputStream _invoke_authentifierClientMobile(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String arg0_in = operateur.identHelper.read(_is);
        String arg1_in = operateur.mdpHelper.read(_is);
        operateur.ClientMobile arg2_in = operateur.ClientMobileHelper.read(_is);

        try
        {
            operateur.UtilisateurAffiche _arg_result = authentifierClientMobile(arg0_in, arg1_in, arg2_in);

            _output = handler.createReply();
            operateur.UtilisateurAfficheHelper.write(_output,_arg_result);

        }
        catch (operateur.Err_Authentification _exception)
        {
            _output = handler.createExceptionReply();
            operateur.Err_AuthentificationHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_authentifierTransporteurMobile(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String arg0_in = operateur.identHelper.read(_is);
        String arg1_in = operateur.mdpHelper.read(_is);
        operateur.TransporteurMobile arg2_in = operateur.TransporteurMobileHelper.read(_is);

        try
        {
            operateur.UtilisateurAffiche _arg_result = authentifierTransporteurMobile(arg0_in, arg1_in, arg2_in);

            _output = handler.createReply();
            operateur.UtilisateurAfficheHelper.write(_output,_arg_result);

        }
        catch (operateur.Err_Authentification _exception)
        {
            _output = handler.createExceptionReply();
            operateur.Err_AuthentificationHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_authentifierStation(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String arg0_in = operateur.identHelper.read(_is);
        String arg1_in = operateur.mdpHelper.read(_is);

        try
        {
            operateur.UtilisateurAffiche _arg_result = authentifierStation(arg0_in, arg1_in);

            _output = handler.createReply();
            operateur.UtilisateurAfficheHelper.write(_output,_arg_result);

        }
        catch (operateur.Err_Authentification _exception)
        {
            _output = handler.createExceptionReply();
            operateur.Err_AuthentificationHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getTransporteur(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        String[] _arg_result = getTransporteur();

        _output = handler.createReply();
        operateur.listTransporteurHelper.write(_output,_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getClient(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        String[] _arg_result = getClient();

        _output = handler.createReply();
        operateur.listClientHelper.write(_output,_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getZoneUtilisateur(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String arg0_in = operateur.identHelper.read(_is);

        try
        {
            String _arg_result = getZoneUtilisateur(arg0_in);

            _output = handler.createReply();
            operateur.zoneHelper.write(_output,_arg_result);

        }
        catch (operateur.Err_id _exception)
        {
            _output = handler.createExceptionReply();
            operateur.Err_idHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getIorTransporteur(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String arg0_in = operateur.identHelper.read(_is);

        try
        {
            operateur.TransporteurMobile _arg_result = getIorTransporteur(arg0_in);

            _output = handler.createReply();
            operateur.TransporteurMobileHelper.write(_output,_arg_result);

        }
        catch (operateur.Err_id _exception)
        {
            _output = handler.createExceptionReply();
            operateur.Err_idHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getIorClient(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String arg0_in = operateur.identHelper.read(_is);

        try
        {
            operateur.ClientMobile _arg_result = getIorClient(arg0_in);

            _output = handler.createReply();
            operateur.ClientMobileHelper.write(_output,_arg_result);

        }
        catch (operateur.Err_id _exception)
        {
            _output = handler.createExceptionReply();
            operateur.Err_idHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_adherer(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String arg0_in = operateur.nomHelper.read(_is);
        String arg1_in = operateur.prenomHelper.read(_is);
        String arg2_in = operateur.adresseHelper.read(_is);
        String arg3_in = operateur.mdpHelper.read(_is);
        String arg4_in = operateur.infoPaiementHelper.read(_is);

        operateur.Rep_Adhesion _arg_result = adherer(arg0_in, arg1_in, arg2_in, arg3_in, arg4_in);

        _output = handler.createReply();
        operateur.Rep_AdhesionHelper.write(_output,_arg_result);

        return _output;
    }

    // operation classes
    private abstract static class AbstractOperation {
        protected abstract org.omg.CORBA.portable.OutputStream invoke(
                GestionUtilisateurPOA target,
                org.omg.CORBA.portable.InputStream _is,
                org.omg.CORBA.portable.ResponseHandler handler);
    }

    private static final class Operation_authentifierClientMobile extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final GestionUtilisateurPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_authentifierClientMobile(_is, handler);
        }
    }

    private static final class Operation_authentifierTransporteurMobile extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final GestionUtilisateurPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_authentifierTransporteurMobile(_is, handler);
        }
    }

    private static final class Operation_authentifierStation extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final GestionUtilisateurPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_authentifierStation(_is, handler);
        }
    }

    private static final class Operation_getTransporteur extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final GestionUtilisateurPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_getTransporteur(_is, handler);
        }
    }

    private static final class Operation_getClient extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final GestionUtilisateurPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_getClient(_is, handler);
        }
    }

    private static final class Operation_getZoneUtilisateur extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final GestionUtilisateurPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_getZoneUtilisateur(_is, handler);
        }
    }

    private static final class Operation_getIorTransporteur extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final GestionUtilisateurPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_getIorTransporteur(_is, handler);
        }
    }

    private static final class Operation_getIorClient extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final GestionUtilisateurPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_getIorClient(_is, handler);
        }
    }

    private static final class Operation_adherer extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final GestionUtilisateurPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_adherer(_is, handler);
        }
    }

}
